package com.showcai.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.showcai.dao.AdvertMapper;
import com.showcai.dao.FeedBackMapper;
import com.showcai.module.Advert;
import com.showcai.module.ApplyMaintain;
import com.showcai.module.BaseModule;
import com.showcai.module.FeedBack;
import com.showcai.myRunTime.MyRunTimeExcption;
import com.showcai.service.AdvertService;
import com.showcai.service.FeedBackService;
import com.showcai.service.ServiceBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by Baggio on 2018-9-5.
 */
@Service
public class FeedBackServiceImpl extends ServiceBase implements FeedBackService {

    @Autowired
    FeedBackMapper feedBackMapper;

    @Override
    public void insertFeedBack(FeedBack feedBack) {
        feedBack.setCreateTime(new Date());
        feedBack.setStatus(BaseModule.STATUS_VALID);
        feedBackMapper.insertFeedBack(feedBack);
    }

    @Override
    public PageInfo getFeedBackList(Integer page, Integer pageSize) {
        PageHelper.startPage(page, pageSize);
        List<FeedBack> list = feedBackMapper.getFeedBackList();
        PageInfo<FeedBack> pageinfo = new PageInfo<>(list);
        return pageinfo;
    }
}

